package com.example.springblog.model;

import com.example.springblog.utils.DateUtils;
import lombok.Data;

import java.util.Date;

@Data
public class BlogInfo {
    private  Integer id;
    private  String title;
    private String content;
    private Integer userId;
    private boolean isLoginUser;
    private Integer deleteFlag;
    private Date createTime;
    private Date updateTime;

    public void setContent(String content) {
//        String markdownRegex = "[*_~`>#\\[!\\-]";
//        content = content.replaceAll(markdownRegex, "");
        this.content = content;
    }

    public String getCreateTime() {
        return DateUtils.dateFormat(createTime);
    }
}
